# -*- coding:utf-8 -*-
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field
from pydantic.alias_generators import to_camel
from typing import List, Literal, Optional, Union
from module_admin.annotation.pydantic_annotation import as_query


class SeedlingsModel(BaseModel):
    """
    表对应pydantic模型
    """
    model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
    breeding_time: Optional[datetime] =  Field(default=None, description='种苗繁育时间')
    description: Optional[str] =  Field(default=None, description='种苗繁育描述')
    display_name: Optional[str] =  Field(default=None, description='展示用种苗名称')
    id: Optional[int] =  Field(default=None, description='种苗唯一标识')
    management_name: Optional[str] =  Field(default=None, description='管理任务名称')
    type: Optional[str] =  Field(default=None, description='种苗类型')


@as_query
class SeedlingsPageModel(SeedlingsModel):
    """
    分页查询模型
    """
    page_num: int = Field(default=1, description='当前页码')
    page_size: int = Field(default=10, description='每页记录数')